	var page=0;
	
	function show(page)
		{
		  if (act_info==undefined)
		   {
		     for (var j=1;j<=5;j++) { var li="li"+j;document.getElementById(li).style.display="none";}
			 document.getElementById("page_number").innerHTML=page+1;
		   }
		  else
		  for (var i=0;i<5;i++)
		   {
		      var index=i+1;
			  var id="li_id";
			  var title="li_title";
			  var brief="li_brief";
			  var gym="li_gym";
			  var number="li_number";
			  var apply_time="li_apply_time";
			  var apply_deadline="li_apply_deadline";
			  var activity_time="li_activity_time";
			  var activity_deadline="li_activity_deadline";
			  var organizer="li_organizer";
			  var max_number="li_max_number";
			  var hide_content="hide_content";
			  var hide_img="hide_img";
			  var back="back";
			  var li_content="li_content";
			  var img_src="li_img";
			  document.getElementById("page_number").innerHTML=page+1;
			  if (page*5+i==act_info.length) 
			  {
			  for (var j=i+1;j<=5;j++)
			    { var li="li"+j;document.getElementById(li).style.display="none";}
			  break;
			  }
			  else
			  {
			  var j=i+1;
			  var li="li"+j;document.getElementById(li).style.display="inline";
			  title+=index;id+=index;brief+=index;gym+=index;number+=index;organizer+=index;max_number+=index;
			  apply_time+=index;apply_deadline+=index;activity_time+=index;activity_deadline+=index;img_src+=index;
			  hide_content+=index;hide_img+=index;back+=index;li_content+=index;
			  document.getElementById(id).innerHTML=act_info[page*5+i].activity_id;
			  document.getElementById(title).innerHTML=act_info[page*5+i].activity_name;
			  document.getElementById(brief).innerHTML=act_info[page*5+i].activity_brief; 
			  document.getElementById(gym).innerHTML=act_info[page*5+i].gymnasium_name;
			  document.getElementById(number).innerHTML=act_info[page*5+i].apply_number;
			  document.getElementById(apply_time).innerHTML=act_info[page*5+i].apply_start_time;
			  document.getElementById(apply_deadline).innerHTML=act_info[page*5+i].apply_end_time;
			  document.getElementById(activity_time).innerHTML=act_info[page*5+i].activity_start_time;
			  document.getElementById(activity_deadline).innerHTML=act_info[page*5+i].activity_end_time;
			  document.getElementById(organizer).innerHTML=act_info[page*5+i].name;
			  document.getElementById(max_number).innerHTML=act_info[page*5+i].max_apply_number;
			  document.getElementById(li_content).innerHTML=act_info[page*5+i].activity_content;
			  //alert(act_info[page*5+i].activity_picture);
			  document.getElementById(img_src).src=act_info[page*5+i].activity_picture;
			  document.getElementById(hide_content).style.display="none";
		      document.getElementById(hide_img).style.display="none";
		      document.getElementById(back).style.display="none";
			 }
			  
		   }
		  }
		
		$(function(){
		 //alert(page);
		 show(page);
		});
		
		function PgUp()
		{
		   if (page==0) {}
		   else 
		   {
		    page--;
		    show(page);
		   }
		}
		function PgDn()
		{ 
		   
		   if (page*5+5>=act_info.length)  {}
		   else 
		   {
		    page++;
			show(page);
		   }
		   
		}
		function add(num)
		{
		   var id="li_id";
		   var number="li_number";
		   id+=num;number+=num;
		   var msg;
		   var apply_number;
		   var act_id=document.getElementById(id).innerHTML;
           $.post('/yuleclub/index.php?m=Home&c=Activity&a=regis',{'act_id':act_id},function(resultList){
                			   
				msg=resultList.msg;
				apply_number=resultList.apply_number;
				document.getElementById(number).innerHTML=apply_number; 
				layer.msg(msg);;
    	     },'json'); 
			 show(page);
           			 
		}
		function showDetail(num)
		{
		  
		  var hide_content="hide_content";
		  var hide_img="hide_img";
		  var back="back";
		  var more="more";
		  hide_content+=num;hide_img+=num;back+=num;more+=num;
		  document.getElementById(hide_content).style.display="block";
		  document.getElementById(hide_img).style.display="block";
		  document.getElementById(back).style.display="inline";
		  document.getElementById(more).style.display="none";
		   //alert(act_info[page*5+num].activity_content);
		}
		function showBack(num)
		{
		  
		  var hide_content="hide_content";
		  var hide_img="hide_img";
		  var back="back";
		  var more="more";
		  hide_content+=num;hide_img+=num;back+=num;more+=num;
		  document.getElementById(hide_content).style.display="none";
		  document.getElementById(hide_img).style.display="none";
		  document.getElementById(back).style.display="none";
		  document.getElementById(more).style.display="inline";
		}